package com.ufaud.ais.pub.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ufaud.ais.pub.dao.IGenericQryDao;
import com.ufaud.ais.pub.service.IGenericQryService;
import com.ufaud.ais.pub.view.PageBean;

public class GenricQryServiceImpl<T, P> implements IGenericQryService<T, P> {
	
	protected final Log log = LogFactory.getLog(getClass());

	protected IGenericQryDao<T, P> iGenericQryDao;

	public GenricQryServiceImpl(final  IGenericQryDao<T, P> genericQryDao) {
		this.iGenericQryDao = genericQryDao;
	}
	
	public List<T> findByQuery(String queryName, P paramObject) {
		return iGenericQryDao.findByNamedQuery(queryName, paramObject);
	}

	public PageBean<T> findPageByQuery(String queryName, P paramObject, int pageIndex, int pageSize) {
		return iGenericQryDao.findPageByNamedQuery(queryName, paramObject, pageIndex, pageSize);
	}

}
